import { BrowserRouter, Route, Routes } from 'react-router-dom'
import './App.css'
import Login from './pages/Login'
import Layout from '@/pages/Layout'
import { AuthComponent } from './components/AuthComponent'
import Publish from './pages/Publish'
import Article from './pages/Artile'
import Home from './pages/Home'
function App () {
  return (
    //路由配置
    <BrowserRouter>
      <div className="App">
        <Routes>
          {/* 这里的Layout不一定不能写死，要根据是否登录进行判断 */}
          <Route
            path='/'
            element={
              <AuthComponent>
                <Layout></Layout>
              </AuthComponent>
            }>
            <Route index element={<Home></Home>}></Route>
            <Route path='article' element={<Article></Article>}></Route>
            <Route path='publish' element={<Publish></Publish>}></Route>
          </Route>
          <Route path="/login" element={<Login></Login>}></Route>
        </Routes>
      </div>
    </BrowserRouter>

  )
}

export default App
